package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/6/29.
 */
@HttpInlet(Conn.INLET_API_INSURANCEORDER_CBUSINESSORDER)
public class PostShangXian extends BaseAsyPost<PostShangXian.Info> {
    public String uid, applicant, insurant_info, vehicle_info, business_risk, insurance_type, covered_area,
            insurance_id, stores_id, total, policy_type, email, dispatching, manager_code, id_url, drive_url, people_car_url,
            id_url_old, drive_url_old, people_car_url_old, starttime, endtime, link_ordersn;

    public PostShangXian(AsyCallBack<PostShangXian.Info> asyCallBack) {
        super(asyCallBack);
    }

    protected Info parser(JSONObject jsonObject) {

        TOAST = jsonObject.optString("message");


        if (jsonObject.optInt("code") == 200) {

            Info info = new Info();
            info.code = jsonObject.optString("code");
            info.data = jsonObject.optString("data");
            info.message = jsonObject.optString("message");
            info.ordersn = jsonObject.optString("ordersn");

            return info;

        }

        return null;
    }

    @Override
    protected boolean skipSecret(String key) {

        return key.equals("id_url") || key.equals("drive_url") || key.equals("people_car_url") ;

    }

    public static class Info {
        public String message, code, data, ordersn;
    }


}
